Questions
1 of 15
1What are the main categories of data types available in MySQL?
2What is the difference between CHAR and VARCHAR data types?
3Which data type would you use to store dates and times in MySQL?
4What is the difference between INT, FLOAT, and DECIMAL data types?
5What is the use of the TEXT and BLOB data types, and how are they different from VARCHAR?
6How does MySQL handle precision and scale in DECIMAL(M, D) columns internally, and how do these differ from FLOAT and DOUBLE in terms of storage and accuracy?
7When storing time zone–aware data, what are the differences in behavior and use cases between DATETIME, TIMESTAMP, and CONVERT_TZ() in MySQL?
8If you define a VARCHAR(255) column with utf8mb4 encoding, how does MySQL calculate the maximum possible storage size for that column, and how does it differ from CHAR(255)?
9What are the advantages and limitations of using ENUM and SET data types in terms of performance, flexibility, and schema evolution?
10Explain how MySQL internally stores and sorts values of type BLOB and TEXT. What happens when you try to index a TEXT column?
11How do signed and unsigned integer types affect query results, index usage, and storage size? Can you demonstrate an example where overflow behavior differs?
12In what scenarios would using a JSON column be preferable to a normalized table structure, and what are the internal storage and indexing implications of JSON in MySQL 8.0?
13How does MySQL’s BIT(M) type differ from BOOLEAN, TINYINT(1), and binary string types (BINARY, VARBINARY) in terms of storage, representation, and retrieval?
14If you define a composite index on multiple columns of different data types (e.g., INT, VARCHAR, and DATE), how do the internal data type differences influence sorting, comparisons, and index efficiency?
15What are the practical implications of using CHAR vs VARCHAR for columns in InnoDB tables with varying row lengths and frequent updates? How does this choice affect row fragmentation and performance?
01 / 15

What are the main categories of data types available in MySQL?

Main Categories of MySQL Data Types

MySQL provides several categories of data types used to store different kinds of information in database tables.

Categories of MySQL Data Types
  1. 1

    Numeric Data Types

  2. 2

    String (Character) Data Types

  3. 3

    Date and Time Data Types

  4. 4

    Boolean Data Type

  5. 5

    Spatial Data Types

  6. 6

    JSON Data Type

Difficulty: 3/10
Topics: numeric types, date/time types, string types

Scenario Questions

0-2 years experience
  1. 1

    You need to store a user's birthdate and a short status code. Which MySQL data types would you choose and why?

  2. 2

    If you defined a column as INT but later need to store values larger than 2^31‑1, what will happen and how would you fix it?

  3. 3

    What does MySQL do when you insert a string longer than the defined length of a VARCHAR column?

2-5 years experience
  1. 1

    Your team added a TEXT column for free‑form comments and noticed query performance degrade. What could be causing the slowdown and how would you address it?

  2. 2

    After importing data, a DATE column is showing '0000-00-00' for some rows. What might be the root cause?

  3. 3

    You need to store a JSON payload in a column, but inserts fail when the JSON is malformed. How would you validate or guard against bad data before insertion?

5-8 years experience
  1. 1

    Design a schema for an e‑commerce order system that must store monetary amounts, timestamps, and flexible attribute data. Explain your choice of MySQL data types and any trade‑offs.

  2. 2

    Your production database has many VARCHAR columns with varying lengths, leading to large index sizes. How would you refactor the schema to improve performance while preserving existing data?

  3. 3

    Explain how the choice of numeric type (INT vs DECIMAL vs BIGINT) impacts storage and query performance in a high‑throughput analytics workload.

8+ years experience
  1. 1

    Your legacy MySQL schema heavily uses ENUM and SET types, which are being deprecated in the upcoming version. How would you plan a migration that minimizes downtime and ensures data integrity?

  2. 2

    When building a multi‑tenant SaaS platform on MySQL, how do you decide between separate databases, separate schemas, or shared tables with a tenant_id column, considering data type constraints and future schema evolution?

  3. 3

    Discuss the long‑term maintenance implications of using MySQL's JSON and spatial types in a data warehouse that must support heavy OLAP queries.

Follow-up Questions

  • How does MySQL store DATE versus DATETIME internally?
  • When would you prefer CHAR over VARCHAR for a column?
  • What are the trade‑offs of using the JSON column type versus a normalized relational design?